# -*- coding: utf-8 -*-
# @Time    : 2021/4/16 20:42
# @Author  : Chen
# @Email   : 2356458272@qq.com
# @File    : 冒泡排序.py
# @Software: PyCharm
a = [4, 3, 1, 9, 6, 7, 5, 2]
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if a[i] > a[j]:
            a.insert(i, a[j])
            #a[i] = a[j]
            del a[j+1:j+2]
            print(a)
        else:
            pass
